import tcdIO.Terminal;

	class LeapYearProgram {


	public static void main(String[] args) {
		
		Terminal terminal1;
		Date date1;
		Date date2;
		
	terminal1 = new Terminal ("Dates");
	
	terminal1.println("Enter date 1:");
	
	date1 = new Date(terminal1.readInt("Enter day: "), terminal1.readInt("Enter Month (1 - 12): "), terminal1.readInt("Enter Year: ") );
	
	while (Date.checkDate(date1.getDay(),date1.getMonth(),date1.getYear()) == false){
		terminal1.println("Error! Date 1 is not a correct date. Please enter again:");
		terminal1.println("");
		date1 = new Date(terminal1.readInt("Enter day: "), terminal1.readInt("Enter Month (1 - 12): "), terminal1.readInt("Enter Year: ") );
	}
	terminal1.println("");
	
	terminal1.println("Enter date two:");
	
	date2 = new Date(terminal1.readInt("Enter day: "), terminal1.readInt("Enter Month (1 - 12): "), terminal1.readInt("Enter Year: ") );
	
	while (Date.checkDate(date2.getDay(),date2.getMonth(),date2.getYear()) == false){
		terminal1.println("Error! Date 2 is not a correct date. Please enter again:");
		terminal1.println("");
		date2 = new Date(terminal1.readInt("Enter day: "), terminal1.readInt("Enter Month (1 - 12): "), terminal1.readInt("Enter Year: ") );
	}
	terminal1.println("");

	if (date1.compareDate(date2) == true){
		terminal1.println("The two dates are equal");
	}
	else {
		terminal1.println("The two dates are not equal");
	}

	if (Date.checkLeapyear(date1.getYear()) == true){
		terminal1.println("Date 1 is in a leap year");
	}
	else{
		terminal1.println("Date 1 is not in a leap year");
	}
	
	if (Date.checkLeapyear(date2.getYear()) == true){
		terminal1.println("Date 2 is in a leap year");
	}
	else{
		terminal1.println("Date 2 is not in a leap year");
	}
	}

}
